package cn.rxmind.dlicense.core.validator;

import cn.rxmind.dlicense.core.base.DLicenseContent;

/**
 * 证书安装时的校验逻辑
 *
 * @author renxin
 * @email renxinzhiliangzhi@163.com
 * @date 2021/4/15 2:09 下午
 */
public class WhenInstallValidator implements DLicenseValidator {

    private final DLicenseValidatorList<DLicenseValidator> validatorList = new DLicenseValidatorList();

    public WhenInstallValidator() {

        this.validatorList.addValidators(new LicenseActiveTimeValidator());
    }

    @Override
    public ValidateResult validateLicense(DLicenseContent content) {

        this.validatorList.validateByOrder(content);

        return this::getClass;
    }
}
